<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<%@ page language="java"  contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<%@ page import="java.util.*" %>
<%@ page import="beans.*" %>
<%@ page import="dao.*" %>
<script>
function check1(){
	form1.submit();
}

</script>
<title>通讯录一览</title>
</head>
<body background="bg3.jpg" style=" background-repeat:no-repeat;
      background-size:100%100%;background-attachment:fixed;">
<style>
form {position:absolute; left:50%; top:70%; transform:translate(-50%,-50%);}
.table3_1 table {
	width:100%;
	margin:15px 0
}
.table3_1 th {
	background-color:#93DAFF;
	color:#000000
}
.table3_1,.table3_1 th,.table3_1 td
{
	font-size:0.95em;
	text-align:center;
	padding:4px;
	border:1px solid #6fcdfe;
	border-collapse:collapse
}
.table3_1 tr:nth-child(odd){
	background-color:#dbf2fe;
}
.table3_1 tr:nth-child(even){
	background-color:#fdfdfd;
}
</style>
<%


//ArrayList persons=txldao.selectinformation(pageno,pagesize);
//ArrayList persons=txldao.selectinformation(pageno,pagesize);
//ArrayList persons=txldao.selectinformation();
ArrayList persons=(ArrayList)session.getAttribute("persons");
int pageno=(int)session.getAttribute("pageno");
int pagecount=(int)session.getAttribute("pagecount");
			
%>

<jsp:useBean id="Person" class="beans.Person"></jsp:useBean>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<h1 align="center">欢迎您  < <%=session.getAttribute("usernow").toString() %> ></h1>
<br>
<h2 align="center">通讯信息库</h2>
<br>
<br>
<div style="width:100%;text-align:center">

		
		
		
		<table class=table3_1  border=0 align="center" >
			<tr>
				<td>序号</td>
				<td>学号</td>
				<td>姓名</td>
				<td>电话</td>
				<td>操作</td>
			</tr>
			<%
				for (int i = 0; i < persons.size(); i++) {
					Person person=(Person)persons.get(i);
			%>
			<tr>
				<td><%=(i+1+5*(pageno-1))%></td>
				<td><%=person.getId()%></td>
				<td><%=person.getName()%></td>
				<td><%=person.getPhone()%></td>
				<td><a href="/5042/showinformation.jsp?name=<%=person.getName()%>">详细</a>&nbsp<a href="/5042/delete?name=<%=person.getName() %>">删除</a></td>
			</tr>
			<%
				}
			%>
			<tr>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td><a href="/5042/insertinformation.jsp">添加</a></td>
			</tr>
		</table>
		</div>
		
		<div align="center">
		<form align="center" name="form1" action="Display">
	
		<%
		if(pageno>1){
			out.print("<tr><td>");
			out.print("<a href='Display?pageno="+(pageno-1)+"'=>上一页 </a> ");
			out.print("</td></tr>");
		}
		for(int i=1;i<=pagecount;i++){
		%>
		<tr>
		<td><a href="Display?pageno=<%=i%>"><%=i %></a></td>
		</tr>
		<%
		}
		if(pageno<pagecount){
			out.print("<tr><td>");
			out.print("<a href='Display?pageno="+(pageno+1)+"'=>下一页 </a> ");
			out.print("<td></tr>");
		}
		%>
		<tr>
		<td>跳转到 <input type="text" style="width:20px" name=jump >    页</td>
		<td><input type="button"  value="跳转" onClick="check1()"/></td>
		</tr>
		</form>
		</div>
</body>
</html>